import plotly.express as px
import plotly
from PIL import Image
import matplotlib.pyplot as plt
%matplotlib inline
data = plotly.data.stocks()
data.head()
| date | GOOG | AAPL | AMZN | FB | NFLX | MSFT | |
|---|---|---|---|---|---|---|---|
| 0 | 2018-01-01 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
| 1 | 2018-01-08 | 1.018172 | 1.011943 | 1.061881 | 0.959968 | 1.053526 | 1.015988 |
| 2 | 2018-01-15 | 1.032008 | 1.019771 | 1.053240 | 0.970243 | 1.049860 | 1.020524 |
| 3 | 2018-01-22 | 1.066783 | 0.980057 | 1.140676 | 1.016858 | 1.307681 | 1.066561 |
| 4 | 2018-01-29 | 1.008773 | 0.917143 | 1.163374 | 1.018357 | 1.273537 | 1.040708 |
fig = px.line(data, x='date', y='MSFT')
fig.show()
plt.plot(data["date"],data["AAPL"])
plt.plot(data["date"],data["AMZN"])
plt.legend(["AAPL","AMZN"])
<matplotlib.legend.Legend at 0x22d2841de50>
| Company | Stock Name |
|---|---|
| GOOG | |
| Apple | AAPL |
| Amazon | AMZN |
| FB | |
| Netflix | NFLX |
| Microsoft | MSFT |
The equation of linear regression is given by:
$$ y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \ldots + \beta_nx_n $$The equation of logistic regression is given by:
$$ p(y=1|x) = \frac{1}{{1 + e^{-(\beta_0 + \beta_1x_1 + \beta_2x_2 + \ldots + \beta_nx_n)}}} $$img = Image.open('../images/image.jpg')
fig = plt.imshow(img)
plt.axis('off')
fig.axes.get_xaxis().set_visible(False)
fig.axes.get_yaxis().set_visible(False)